//
//  CodeHelper.h
//  TVLive
//
//  Created by 肖康龙 on 2017/6/5.
//  Copyright © 2017年 vsoontech. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface CodeHelper : NSObject
//MD5
+ (NSString *) md5:(NSString *)str;

//Base64
+ (NSString *)base64StringFromText:(NSString *)text;
+ (NSString *)textFromBase64String:(NSString *)base64;
+ (NSString *)base64EncodedStringFrom:(NSData *)data;
+ (NSData *)bas64From:(NSData *)data;

//DES加密
+(NSString *)encryptSting:(NSString *)sText key:(NSString *)key andDesiv:(NSString *)ivDes;

//DES解密
+(NSString *)decryptWithDESString:(NSString *)sText key:(NSString *)key andiV:(NSString *)iv;

//AES加密
+ (NSData *)AES128EncryptWithKey:(NSString *)key iv:(NSString *)iv withNSData:(NSData *)data;

//AES解密
+ (NSData *)AES128DecryptWithKey:(NSString *)key iv:(NSString *)iv withNSData:(NSData *)data;










/*i参数加密*/
+(NSString *)AESDecryptIWithType:(int)type isMobileTV:(BOOL)isMobileTV;
/**id 视频ID*/
+(NSString *)getSoucressListCodeID:(NSString *)codeId;
/*流量上报
 e.appKey	appkey	 String
 e.resourceID	资源id	String
 e.playTime	播放时长，单位秒	Int
 e.accelSize	加速流量，单位字节	Long
 e.vcSize	Vc总的有效流量	Long
 e.vc		数组
 e.vc.host	Vc节点host	String
 e.vc.tSize	Vc节点总流量，单位字节	Long
 e.vc.vSize	Vc节点有效流量，单位字节	Long
 */
+(NSString *)getReportWithResourceID:(NSString *)resourceID
                            playTime:(NSUInteger)playTime
                           accelSize:(NSUInteger)accelSize
                              vcSize:(NSUInteger)vcSize
                                  vc:(NSArray *)vc;
/*解密左边分类*/
+(NSDictionary *)decryptionPlayDataWithString:(NSData *)data;
/*解密秘钥*/
+(NSDictionary *)decryptionKeyWithString:(NSData *)data;



@end
